# Contributor: Steve McMaster <code@mcmaster.io>
# Contributor: Alexander Sack <asac@pantacor.com>
# Maintainer: Sertonix <sertonix@posteo.net>
pkgname=tpm2-tools
pkgver=5.7
pkgrel=1
pkgdesc="TPM2 Tools"
url="https://github.com/tpm2-software/tpm2-tools/"
arch="all"
license="BSD-2-Clause"
makedepends="
	curl-dev
	openssl-dev>3
	tpm2-tss-dev
	tpm2-tss-esys
	tpm2-tss-fapi
	tpm2-tss-rc
	tpm2-tss-sys
	tpm2-tss-tctildr
	util-linux-dev
	"
subpackages="$pkgname-doc $pkgname-bash-completion"
source="https://github.com/tpm2-software/tpm2-tools/releases/download/$pkgver/tpm2-tools-$pkgver.tar.gz"
options="!check"

# secfixes:
#   5.7-r0:
#     - CVE-2024-29038
#     - CVE-2024-29039

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
629b0b1826815877f452935285f7b3fe0f32bd24fe9130eb169a2dc9b7b254a737797043af9eea68be706b87c32ab2b7189151360c9c00bc5c31dce62a799670  tpm2-tools-5.7.tar.gz
"
